/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.skuboard.model.dao;

import java.util.List;
import javax.ejb.EJB;
import org.skuboard.model.Student;
import org.skuboard.session.StudentsFacade;
import org.skuboard.session.UsersFacade;

/**
 *
 * @author clockbuilder
 */
public class SchoolDAOEntityImp implements SchoolDAO {

    @EJB
    private StudentsFacade studentsFacade;
    private UsersFacade usersFacade;

    
    public SchoolDAOEntityImp(){
        studentsFacade = new StudentsFacade();
        usersFacade = new UsersFacade();
    }
    @Override
    public Student getStudentById(String studentId) {
       return usersFacade.findStudentByID(studentId);
    }

    @Override
    public boolean removeStudentById(String studentId) {

        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public List<Student> getAllStudents() {
        return usersFacade.findByUserType("student");
    }

    @Override
    public boolean addStudent(Student newStudent) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public String getallStudentsInfo() {
       throw new UnsupportedOperationException("Not supported yet.");
       
    }

    @Override
    public String getStudentInfo(String studentId) {
        return this.getStudentById(studentId).toString();
    }
}
